package com.liuguang.testassert.common.myassert;

import com.liuguang.testassert.common.exception.ParamIsNullException;
import org.springframework.util.StringUtils;

import java.util.Objects;

/**
 * @ClassName: BaseAssert
 * @Description：
 * @Author: wanghr
 * Date: 3:17 PM 2020/5/30
 * Version: 1.0
 */
public interface BaseAssert {
    default void assertNotNull(Object o) {
        if (o instanceof String) {
            String param = (String) o;
            if (StringUtils.isEmpty(param)) {
                throw throwException();
            }
        } else if(o == null) {
            throw throwException();
        }
    }

    ParamIsNullException throwException();
}
